<!DOCTYPE html>
<html lang="zh">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>服务器控制</title>
    <meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1,user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <!--标准mui.css-->
    <link rel="stylesheet" href="/static/css/mui.min.css">
    <!--App自定义的css-->
    <link rel="stylesheet" type="text/css" href="/static/css/app.css">
    <style>
    </style>
</head>
<body>
<header class="mui-bar mui-bar-nav">
    <a class="mui-action-back mui-icon mui-icon-back mui-pull-left"></a>
    <h1 class="mui-title">选择目标IP</h1>
</header>
<div class="mui-content">
    <ul class="mui-table-view" id="list">
    </ul>
</div>


</body>
<script src="/static/js/mui.min.js"></script>
<script src="/static/js/jquery-1.11.3.min.js"></script>
<script type="text/javascript" charset="UTF-8">
    //mui初始化
    mui.init({
        swipeBack: true //启用右滑关闭功能
    });

    $(document).ready(function () {
        mui.post('/service/ipList', function (data) {
                if (data.code === 200) {
                    for (let i = 0; i < data.data.length; i++) {
                        $("#list").append("<li class='mui-table-view-cell' id='" + i + "' onclick='runCmd(" + i + ")' >" + data.data[i] + "</li>");
                    }
                } else {
                    mui.toast(data.msg);
                }
            }, 'json'
        );
    })

    function runCmd(id) {
        window.location.href = "/serviceList?id=" + id;
    }
</script>

</html>